package org.jeecg.modules.bid.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.bid.entity.BidRecord;
import org.jeecg.modules.bid.mapper.BidRecordMapper;
import org.jeecg.modules.bid.service.IBidRecordService;
import org.springframework.stereotype.Service;

/**
 * @Description: 报价记录服务实现类
 * @Author: jeecg-boot
 * @Date: 2023-04-15
 * @Version: V1.0
 */
@Service
public class BidRecordServiceImpl extends ServiceImpl<BidRecordMapper, BidRecord> implements IBidRecordService {

    @Override
    public int countByPurchaseIdAndSupplierId(String purchaseId, String BidId) {
        // 构建查询条件
        QueryWrapper<BidRecord> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("purchase_id", purchaseId);
        queryWrapper.eq("bid_id", BidId);

        // 调用父类方法查询记录数量
        return (int) this.count(queryWrapper);
    }
}
